from django.db import models

# Create your models here.


class Student(models.Model):
    """ 下一个写model层的小可爱记住：没有那把剑，我照样可以歼灭敌军 """
    SEX_ITEM = [
        (1, '男'),
        (2, '女'),
        (3, '未知')
    ]

    STATUS_ITEM = [
        (0, '申请'),
        (1, '通过'),
        (2, '拒绝')
    ]

    name = models.CharField(max_length=128, verbose_name='姓名')
    sex = models.IntegerField(choices=SEX_ITEM, verbose_name='性别')
    profession = models.CharField(max_length=128, verbose_name='职业')
    email = models.EmailField(verbose_name='Email')
    qq = models.CharField(max_length=128, verbose_name='QQ')
    phone = models.CharField(max_length=128, verbose_name='电话')
    status = models.IntegerField(choices=STATUS_ITEM, default=0, verbose_name='审核状态')
    crated_time = models.DateTimeField(auto_now_add=True, editable=False, verbose_name='创建时间')

    def __str__(self):
        return '<Student: {}>'.format(self.name, self.sex)

    class Meta:
        verbose_name = verbose_name_plural = '学员信息'
